package com.biz.primus.ms.member.dao.po;

import com.biz.primus.model.member.enums.ClientTypes;
import com.biz.primus.model.member.enums.FootprintActionTypes;
import com.biz.primus.ms.base.jpa.po.BaseEntityPKIncrement;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 会员足迹
 * @author jun.liu
 * @date 2017年10月22日
 * @reviewer
 * @see
 */
@Entity
@Table(name = "member_footprint")
@Data
@EqualsAndHashCode(callSuper = true)
public class MemberFootprint extends BaseEntityPKIncrement
{

    /**
     * 当前ip
     */
    @Column(name = "current_ip", length = 16)
    private String currentIp;

    /**
     * 纬度
     */
    @Column(columnDefinition = "DECIMAL(9,6)")
    private BigDecimal loginLat;

    /**
     * 经度
     */
    @Column(columnDefinition = "DECIMAL(9,6)")
    private BigDecimal loginLon;

    /**
     * 关联商品Product对象
     */
    @Column(name = "product_code")
    private String productCode;

    /**
     * 足迹动作
     */
    @Convert(converter=FootprintActionTypes.Converter.class)
    @Column
    private FootprintActionTypes footprintActionType;

    /**
     * 关联会员详情Member对象
     */
    @Column(name = "memberId")
    private Long memberId;

    /**
     * 客户端类型
     */
    @Convert(converter=ClientTypes.Converter.class)
    @Column
    private ClientTypes fotprintClientType;

    /**
     * 用户清理的足迹设为true
     * true 表示已经清理 false表示未清理
     */
    @Column
    private Boolean clean = false;
}
